<!-- begin r_sidebar -->

<div id="sidebar">

	<ul id="sidebarwidgeted">
	<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Right Sidebar') ) : ?>
    
        <li id="quick-search" class="widget">
            <h2>Quick Search</h2>    
            <?php wp_dropdown_categories('show_option_none=Select category&hierarchical=true'); ?>
            <script type="text/javascript"><!--
                var dropdown = document.getElementById("cat");
                function onCatChange() {
                    if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
                        location.href = "<?php echo get_option('home');
            ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
                    }
                }
                dropdown.onchange = onCatChange;
            --></script> 
        </li>
    	
		<li id="recent-posts" class="widget">
            <h2>Recent Posts</h2>
                <ul>
                    <?php wp_get_archives('type=postbypost&limit=5'); ?> 
                </ul>
		</li>	
        
        <li id="archives" class="widget">
            <h2>Archives</h2>
                <ul>
					<?php wp_get_archives('type=monthly'); ?>
                </ul>
        </li>

		<li id="links" class="widget">
			<h2>Links</h2>
				<ul>
					<?php wp_list_bookmarks('title_li=&categorize=0'); ?>
				</ul>
		</li>
		
	<?php endif; ?>
	</ul>
			
</div>

<!-- end r_sidebar -->